<template>
  <div>
    <van-grid square column-num="4" icon-size="13vw">
    <van-grid-item v-for="(v,index) in flarr" :key="index" :icon="v" :text="flarr1[index]"  @click="weidian(index)"/>
    </van-grid>
  </div>
</template>

<script>
export default {
    data(){
          return{
              flarr:[],
              flarr1:[]
          }
      },
      methods:{
        weidian(index){
          if(index == 2){
            this.$router.push("/wei")
          }else if(index == 3){
            this.$router.push("/chang")
          }
        }
      },
      mounted(){       
          this.$http({
              url:"http://localhost:3000/navigation",
              method:"get"
          }).then(res=>{
            res.data.forEach(element => {
                this.flarr = element.data.myimg
                this.flarr1 = element.data.hxtext
            })            
          })
        }    
}
</script>

<style scoped>

</style>